from enum import Enum


class NodeType(Enum):
    other = '00'  # 其他
    normal = '01'  # 普通节点
    junction = '02'  # 交叉口
    road_start = '03'  # 断头路起始点
    road_end = '04'  # 断头路终止点
    roundabout = '05'  # 环岛
    connecting = '06'  # 连接
    virtual = '07'  # virtual

    # 类型转换
    @staticmethod
    def typeTrans(key):
        try:
            value = NodeType[key.lower()].value
        except Exception:
            value = NodeType.other.value
        return value


class LaneColor(Enum):
    white = 1
    yellow = 2
    orange = 3
    blue = 4
    white_yellow = 5
    yellow_white = 6
    other = 7


def main():
    # pass
    c1 = LaneColor['white']
    # c2 = LaneColor['whi2te']
    print(c1.value)
    # print(c2.value)

    c3 = LaneColor.white
    print(c3.name)
    print(c3.value)

    print(NodeType.junction.value)


if __name__ == '__main__':
    main()
